class HtmlFrameWriter:


    def add_start(self,path):
        path=path.split(r"/")[-1]
        #print(path)
        style="""<style> div.frame {position:absolute;color:transparent}  body {width:792px;height:1120px;background-image: url("""
        style=style+path
        style=style+""");background-repeat:no-repeat;border:1px solid black;margin:0px}</style>"""
        begain="<html><head>{}</head><body>".format(style)
        return begain

    def add_div(self,words,width,top,height,left,path):
        div="""<div class="frame" id="{}" style="width:{}px;height:{}px;top:{}px;left:{}px">{}</div>""".format(path,width,height,top,left,words)
        return div

    def add_end(self):
        end="</body></html>"
        return end
